﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcMall.Core.Domains;
using MvcMall.Portal.Controllers.Users.ViewModels;

namespace MvcMall.Portal.Controllers.Users.Mappers
{
    public class UserToUserInfoModelMapper
    {
        public static UserInfoModel MapFrom(User input)
        {
            return new UserInfoModel
                       {
                           Birthday = input.Birthday,
                           Email = input.Email,
                           Mobile = input.Mobile,
                           Phone = input.Phone,
                           QQ = input.QQ,
                           RealName = input.RealName,
                           Sex = Convert.ToInt32(input.Sex),
                           UserHeaderImage = input.UserHeaderImage,
                           UserName = input.UserName
                       };
        }
    }
}
